package Exeption;

import java.lang.Exception;
import java.util.Scanner;

public class Test1 {

    public static int func1(int a) throws Exception, ArithmeticException{
        if (a < 0) {
            throw new Exception("输入的数为负数");
        } else if (a == 0) {
            throw new ArithmeticException("除数为0");
        }

        return a;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int a = 0;
        try{
            a = func1(sc.nextInt());
        } catch (ArithmeticException e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            System.out.println(a);
        }
    }
}
